<%@ page language="java" contentType="text/html; charset=UTF-8" import="org.apache.shiro.SecurityUtils" pageEncoding="UTF-8"%>
<%@ taglib prefix="spring" uri="http://www.springframework.org/tags"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="shiro" uri="http://shiro.apache.org/tags"%>
<c:set var="ctx" value="<%=request.getContextPath()%>" />
<c:set var="user" scope="session" value="<%=SecurityUtils.getSubject().getPrincipal()%>" />
<div id="navbar" class="navbar navbar-default">
	<script type="text/javascript">
		try {
			ace.settings.check('navbar', 'fixed')
		} catch (e) {
		}
		var root='${ctx}';
	</script>
	<div class="navbar-container" id="navbar-container">
		<!-- #section:basics/sidebar.mobile.toggle -->
		<button type="button" class="navbar-toggle menu-toggler pull-left"
			id="menu-toggler" data-target="#sidebar">
			<span class="sr-only">Toggle sidebar</span> <span class="icon-bar"></span>

			<span class="icon-bar"></span> <span class="icon-bar"></span>
		</button>

		<!-- /section:basics/sidebar.mobile.toggle -->
		<div class="navbar-header pull-left">
			<!-- #section:basics/navbar.layout.brand -->
			<a href="#" class="navbar-brand"> <small> <i
					class="fa fa-dribbble"></i> ${sessionScope.APP_NAME}
			</small>
			</a>

			<!-- /section:basics/navbar.layout.brand -->

			<!-- #section:basics/navbar.toggle -->

			<!-- /section:basics/navbar.toggle -->
		</div>

		<!-- #section:basics/navbar.dropdown -->
		<div class="navbar-buttons navbar-header pull-right" role="navigation">
			<ul class="nav ace-nav">
				<li class="weather">
					<div style="color: white;" id="weather"></div>
				</li>
				<li class="green"><a data-toggle="dropdown"
					class="dropdown-toggle" href="#"> <i
						class="ace-icon fa fa-envelope icon-animated-vertical"></i> <span
						class="badge badge-success">5</span>
				</a>

					<ul
						class="dropdown-menu-right dropdown-navbar dropdown-menu dropdown-caret dropdown-close">
						<li class="dropdown-header"><i
							class="ace-icon fa fa-envelope-o"></i> 5 Messages</li>

						<li class="dropdown-content">
							<ul class="dropdown-menu dropdown-navbar">
								<li><a href="#" class="clearfix"> <img
										src="${user.headimgurl}" class="msg-photo" alt="Alex's Avatar" />
										<span class="msg-body"> <span class="msg-title">
												<span class="blue">Alex:</span> Ciao sociis natoque
												penatibus et auctor ...
										</span> <span class="msg-time"> <i
												class="ace-icon fa fa-clock-o"></i> <span>a moment
													ago</span>
										</span>
									</span>
								</a></li>

								<li><a href="#" class="clearfix"> <img
										src="${user.headimgurl}" class="msg-photo"
										alt="Susan's Avatar" /> <span class="msg-body"> <span
											class="msg-title"> <span class="blue">Susan:</span>
												Vestibulum id ligula porta felis euismod ...
										</span> <span class="msg-time"> <i
												class="ace-icon fa fa-clock-o"></i> <span>20 minutes
													ago</span>
										</span>
									</span>
								</a></li>

								<li><a href="#" class="clearfix"> <img
										src="${ctx}/resources/assets/avatars/avatar4.png"
										class="msg-photo" alt="Bob's Avatar" /> <span
										class="msg-body"> <span class="msg-title"> <span
												class="blue">Bob:</span> Nullam quis risus eget urna mollis
												ornare ...
										</span> <span class="msg-time"> <i
												class="ace-icon fa fa-clock-o"></i> <span>3:15 pm</span>
										</span>
									</span>
								</a></li>

								<li><a href="#" class="clearfix"> <img
										src="${ctx}/resources/assets/avatars/avatar2.png"
										class="msg-photo" alt="Kate's Avatar" /> <span
										class="msg-body"> <span class="msg-title"> <span
												class="blue">Kate:</span> Ciao sociis natoque eget urna
												mollis ornare ...
										</span> <span class="msg-time"> <i
												class="ace-icon fa fa-clock-o"></i> <span>1:33 pm</span>
										</span>
									</span>
								</a></li>

								<li><a href="#" class="clearfix"> <img
										src="${ctx}/resources/assets/avatars/avatar5.png"
										class="msg-photo" alt="Fred's Avatar" /> <span
										class="msg-body"> <span class="msg-title"> <span
												class="blue">Fred:</span> Vestibulum id penatibus et auctor
												...
										</span> <span class="msg-time"> <i
												class="ace-icon fa fa-clock-o"></i> <span>10:09 am</span>
										</span>
									</span>
								</a></li>
							</ul>
						</li>

						<li class="dropdown-footer"><a href="inbox.html"> See all
								messages <i class="ace-icon fa fa-arrow-right"></i>
						</a></li>
					</ul></li>
				<!-- #section:basics/navbar.user_menu -->
				<li class="light-blue"><a data-toggle="dropdown" href="#"
					class="dropdown-toggle"> <c:if test="${user.headimgurl==null}">
							<img class="nav-user-photo"
								src="${ctx}/resources/assets/avatars/${user.sex==0?'avatar3.png':'avatar4.png'}"
								alt="默认头像" />
						</c:if> <c:if test="${user.headimgurl!=null}">
							<img class="nav-user-photo" src="${user.headimgurl}" alt="微信头像" />
						</c:if> <span class="user-info"> <small>欢迎,</small>
							${user.nickname==null?user.username:user.nickname}
					</span> <i class="ace-icon fa fa-caret-down"></i>
				</a>

					<ul
						class="user-menu dropdown-menu-right dropdown-menu dropdown-yellow dropdown-caret dropdown-close">
						<li><a href="javascript:void(0);"> <i
								class="ace-icon fa fa-user"></i>账户[${user.username}]
						</a></li>
						<li><a href="javascript:void(0);"> <i
								class="ace-icon fa fa-user"></i>角色[
								<c:forEach items="${user.roles}" var="item">
									${item.name}
								</c:forEach>
								]
						</a></li>
						<li class="divider"></li>
						<%-- 							<li><a href="javascript:settingUserInfo('${ctx}/user/info/search','设置个人信息');"> <i class="ace-icon fa fa-cog"></i> 设置个人信息</a></li> --%>
<!-- 						<li><a -->
<%-- 							href="javascript:settingUserInfo('${ctx}/user/info/update/to/password','设置登陆密码');"> --%>
<!-- 								<i class="ace-icon fa fa-lock"></i> 设置登陆密码 -->
<!-- 						</a></li> -->
						<li><a
							href="javascript:settingUserInfo('/user/toPassword','设置登陆密码');">
								<i class="ace-icon fa fa-lock"></i> 设置登陆密码
						</a></li>
						<li class="divider"></li>
						<li><a href="${ctx}/user/logout"> <i
								class="ace-icon fa fa-power-off"></i>退出系统
						</a></li>
					</ul></li>

				<!-- /section:basics/navbar.user_menu -->
			</ul>
		</div>

		<!-- /section:basics/navbar.dropdown -->
	</div>
	<!-- /.navbar-container -->
</div>
